<?php
/* @var $this PageController */
/* @var $model Page */

$this->widget('bootstrap.widgets.TbBreadcrumbs',array(
	'links'=>array(
		'Pages'=>array('admin'),
		$model->name=>array('viewAdmin','id'=>$model->id),
		'Update'
	),
));

$this->menu=array(
	array('label'=>'Operations'),
	array('label'=>'Create Page', 'icon'=>'star', 'url'=>array('create')),
	array('label'=>'View Page', 'icon'=>'eye-open', 'url'=>array('viewAdmin', 'id'=>$model->id)),
	array('label'=>'Update Page', 'icon'=>'pencil', 'url'=>'#', 'active'=>true),
	array('label'=>'Delete Page', 'icon'=>'trash', 'url'=>'#', 'disabled'=>true),
	array('label'=>'Manage Pages', 'icon'=>'cog', 'url'=>array('admin')),
	array('label'=>'List Pages', 'icon'=>'th-list', 'url'=>array('index')),
	array('label'=>'Page Options'),
	array('label'=>'Add Content to Page', 'icon'=>'tasks', 'url'=>array('content/create','page'=>$model->id)),
);
?>

<div class="row">
	<div class="span9">
		<div style="padding: 10px;">
<h2>Update Page - <?php echo $model->name; ?></h2>
			<div class="tabbable tabs-left">
				<ul class="nav nav-tabs" id="pageTab">
					<li class="active"><a href="#homeTab" data-toggle="tab">Page</a></li>
					<li><a href="#contentTab" data-toggle="tab"<?php if(count($model->contents)==0) { ?> style="color: #F00;"<?php } ?>>Contents</a></li>
				</ul>

				<div class="tab-content">
					<div class="tab-pane active" id="homeTab">
						<?php $this->renderPartial('_form', array('model'=>$model)); ?>
					</div>
					<div class="tab-pane" id="contentTab">
						<h3><?php echo CHtml::link('Contents', array('content/admin','page'=>$model->id)); ?></h3>

						<?php $this->widget('bootstrap.widgets.TbListView', array(
							'dataProvider'=>$contentDataProvider,
							'itemView'=>'/content/_view',
						)); ?>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="span3">
	<?php
		$this->beginWidget('zii.widgets.CPortlet', array(
			'title'=>'Administration',
		));
		$this->widget('bootstrap.widgets.TbMenu',array(
			'type'=>'list',
			'items'=>$this->menu,
		));
		$this->endWidget();
	?>
	</div>
</div>
